package com.warmguard.core.controlller;

import com.warmguard.core.core.vo.Result;
import com.warmguard.core.domain.dto.UserLoginDTO;
import com.warmguard.core.domain.vo.UserLoginVO;
import com.warmguard.core.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * ClassName: MemberController
 * PackageName: com.warmguard.core.controlller
 * Description:
 *
 * @Author: 32782
 * @Date: 2025/1/21 下午10:05
 * @Version: 1.0
 */
@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private MemberService memberService;

    /**
     * 微信登录
     *
     * @param userLoginDTO
     * @return
     */
    @PostMapping("/login")
    public Result<UserLoginVO> login(@RequestBody UserLoginDTO userLoginDTO) {
        //微信登录
        UserLoginVO userLoginVO = memberService.wxLogin(userLoginDTO);
        return Result.ok(userLoginVO);
    }
}
